package com.cskaoyan.javase.oop1._7bigexercise._0lol;

/**
 * @description: 面向对象基础语法的练习
 * @author: wuguidong@cskaoyan.onaliyun.com
 **/

/**
 *  > 完成以下案例，学会案例并且抽取出对象和相应的类
 * - 用面向对象的思想模拟LOL当中盖伦的战斗
 *  盖伦是一个英雄(legend)类的对象
 *  他们都有的属性是: QWER,名字,血量
 *  行为: 回城,战斗
 *
 *
 * - 用面向对象的思想模拟植物大战僵尸
 */
public class Demo {
    public static void main(String[] args) {
        //创建"盖伦"对象
        Legend legend1 = new Legend("德玛西亚之力-盖伦", "沉默", "勇气", "审判", "大宝剑", 2000);
        System.out.println(legend1.fight());
    }

}

//创建英雄类
class Legend {
    //属性
    String skillQ;
    //ctrl + D 复制到下一行,Ctrl + Y删除一行
    String skillW;
    String skillE;
    String skillR;
    String name;
    int hp;

    //行为
    //回城
    public void backHome() {
        System.out.println("快速回城逛淘宝~");
    }

    public String fight() {
        return "英雄" + this.name + "正在使用" + this.skillR + "战斗!";
    }

    //构造器


    public Legend() {
    }

    public Legend(String name, String skillQ, String skillW, String skillE, String skillR, int hp) {
        this.skillQ = skillQ;
        this.skillW = skillW;
        this.skillE = skillE;
        this.skillR = skillR;
        this.name = name;
        this.hp = hp;
    }
}
